<template>
    <div class="app-container">
        <el-form @submit.native.prevent :model="queryParams" ref="queryForm"  :inline="true"
            v-show="showSearch">
            <el-form-item label="库房" prop="userName">
                <el-input v-model="queryParams.userName" placeholder="请输入查询的内容" clearable style="width: 240px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="日期" prop="userName">
                <el-input v-model="queryParams.userName" placeholder="请输入查询的内容" clearable style="width: 240px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="业务状态" prop="userName">
                <el-input v-model="queryParams.userName" placeholder="请输入查询的内容" clearable style="width: 240px"
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" icon="el-icon-search"  @click="handleQuery">搜索</el-button>
                <el-button icon="el-icon-refresh"  @click="resetQuery">重置</el-button>
            </el-form-item>
        </el-form>
        <el-row :gutter="10" class="mb8" ref="refbut">
                    <el-col :span="1.5">
                        <el-button type="primary" plain icon="el-icon-plus" @click="handleJieshouTap()">调卷完成</el-button>
                    </el-col>
        </el-row>
        <el-table v-loading="loading" border :height="tableHeight" :data="tenantList"
            @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="序号" type="index" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template slot-scope="scope">
                    <el-button  type="text" icon="el-icon-collection" @click="handleDocument(scope.row)">调卷</el-button>
                    <el-button  type="text" icon="el-icon-printer" @click="handleDocument(scope.row)">打印</el-button>
                </template>
            </el-table-column>
            <el-table-column label="库房" prop="registeredUnit" :show-overflow-tooltip="true" />
            <el-table-column label="调卷日期" prop="registeredUnit" :show-overflow-tooltip="true" />
            <el-table-column label="调卷人" prop="registeredUnit" :show-overflow-tooltip="true" />
            <el-table-column label="调卷人处室" prop="registeredUnit" :show-overflow-tooltip="true" />
            <el-table-column label="业务状态" prop="registeredUnit" :show-overflow-tooltip="true" />
            <el-table-column label="备注" prop="registeredUnit" :show-overflow-tooltip="true" />          
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
            @pagination="getList" />
       <queryData v-if="isOpen" :isOpen="isOpen" :superviseRow="superviseRow" @closeDelDialog="closeDelDialog"></queryData>
    </div>
</template>

<script>
import { listTENANT, addTENANT, getTENANT, updateTENANT, delTENANT, changeTENANTStatus } from "@/api/manage/infoManage";
import {tenantList} from "@/api/archive/supervision/supervisesNew/supervisesNew.js"
import queryData from "@/views/archive/supervision/supervisesNew/queryData.vue"
import estimateTableHeight from '@/mixins/estimateTableHeight'//vue项目中element-tabel自动计算高度
export default {
    name: "Role",
    dicts: ['sys_normal_disable'],
    mixins: [estimateTableHeight], // 混入方法
    components:{
        queryData
    },
    data() {
        return {
            // 遮罩层
            loading: true,
            // 选中数组
            ids: [],
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,
            // 显示搜索条件
            showSearch: true,
            // 总条数
            total: 0,
            // 立档单位列表表格数据
            tenantList: [],
            // 弹出层标题
            title: "",
            // 是否显示弹出层
            open: false,
            // 查询参数
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                userName: undefined,
            },

            isOpen:false,
            superviseRow:""
           
        };
    },
    created() {
        this.getList();
        console.log(this.dict.type.sys_normal_disable)
    },
    methods: {

       
        /** 查询立档单位列表 */
        getList() {
            this.loading = true;
            tenantList(this.queryParams).then(response => {
                this.tenantList = response.rows;
                this.total = response.total;
                this.loading = false;
            }
            );
        },
        // 表单重置
        reset() {
            this.form = {
                registeredUnit: null,
                registeredPerson: null,
                userName: null,
                loginName: null,
                passWord: null,
                remark: null,
                tenantCode: null,
                fondsCode: null,
                state: "1"   //1=关闭，0=开启
            };
            this.resetForm("form");
        },
        /** 搜索按钮操作 */
        handleQuery() {
            this.queryParams.pageNum = 1;
            this.getList();
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.resetForm("queryForm");
            console.log(this.resetForm("queryForm"), "sdlfjlk")
            this.handleQuery();
        },
        // 多选框选中数据
        handleSelectionChange(selection) {
            this.ids = selection.map(item => item.roleId)
            this.single = selection.length != 1
            this.multiple = !selection.length
        },
       //查看
        handleDocument(row){
            var that=this;
            that.isOpen=true
            that.superviseRow=row
        },

        //关闭查看
        closeDelDialog(){
            var that=this;
            that.isOpen=false;

        }

  
    }
};
</script>
<style lang="scss" scoped></style>
